{% include "rpgEngine/head.html" %}
<script language="JavaScript">onLoadAnchor = '{{onLoadAnchor}}';</script>
<script language="JavaScript" src="{{ MEDIA_URL }}shared/team.js"></script>
<div id="char_busy_with_original" class="char_hidden" >{{char_sheet.busy_with}}</div>
<div id="char_location_time_original" class="char_hidden" >{{char_sheet.location_time}}</div>
<div id="char_general_carac_original" class="char_hidden" >{{char_sheet.general_carac}}</div>
<div id="char_carac_reaction_original" class="char_hidden" >{{char_sheet.carac_reaction}}</div>
<div id="char_advantage_disadvantage_original" class="char_hidden" >{{char_sheet.advantage_disadvantage}}</div>
<div id="char_skills_original" class="char_hidden" >{{char_sheet.skills}}</div>
<div id="char_defense_original" class="char_hidden" >{{char_sheet.defense}}</div>
<div id="char_movement_original" class="char_hidden" >{{char_sheet.movement}}</div>
<div id="char_dark_corner_original" class="char_hidden" >{{char_sheet.dark_corner}}</div>
<div id="primarycontent">
	<div class="teamPageSelect">
		{% autoescape off %}
		{{ pageSelect }}
		{% endautoescape %}
	</div>
	<h1>Team : {{first_n}} {{last_n}}</h1>
	{% if isErrorCharacter %}
		<p id="errorMessage">An error occured... try saving again</p>
	{% endif %}
	<form id="character_sheet_form" action="/team/playerForMaster/{{char_sheet.player_id}}/submitForm/character/" method="post">
	<table class="char_table">
		<tr>
			<td class="char_cell_first_column"></td>
			<td class="char_cell_second_column"></td>
			<td class="char_cell_third_column"></td>
		</tr><tr>
			<td class="char_cell">
				<div class="char_timestamp"><strong>Last Login</strong></div>
				<div class="char_timestamp">{{last_login}}</div>
				<div class="char_timestamp"><strong>Last Post</strong></div>
				<div class="char_timestamp">{{last_post}}</div>
			</td>
			<td  class="char_cell" colspan="2">
				<h4>Busy with</h4>
				{{form.busy_with}}
			</td>
		</tr><tr>
			<td class="char_cell">
				<h4>Location & Time</h4>
				{{form.location_time}}
			</td>
			<td class="char_cell" colspan="2">
				<h4>General Caracteristics</h4>
				{{form.general_carac}}
			</td>
		</tr><tr>
			<td class="char_cell" colspan="2">
				<h4>Caracteristics & Reaction</h4>
				{{form.carac_reaction}}
			</td>
			<td class="char_cell">
				<h4>Advantages, Disadvantages & Disabilities</h4>
				{{form.advantage_disadvantage}}
			</td>
		</tr><tr>
			<td class="char_cell" rowspan="2" colspan="2">
				<h4>Skills</h4>
				{{form.skills}}
			</td>
			<td class="char_cell">
				<h4>Defense</h4>
				{{form.defense}}
			</td>
		</tr><tr>
			<td class="char_cell">
				<h4>Movement</h4>
				{{form.movement}}
			</td>
		</tr><tr>
			<td class="char_cell" colspan="3">
				<h4>Dark Corner</h4>
				{{form.dark_corner}}
			</td>
		</tr>
		<tr>
			<td td colspan="4" style="text-align:right;"><input type="submit" id="addItem" name="addItem" value="Save" alt="Save Item" /></td>
		</tr>
	</table>
	</form>
	<a name="inventoryAnch" id="inventoryAnch" ></a>
	<h1>Team : {{first_n}} {{last_n}} : Inventory</h1>
	</br>
	<form id="formAddItem" action="/team/playerForMaster/{{char_sheet.player_id}}/submitForm/item/" method="post">
	<table>
		<tr><td>{{ formInventory.name.label_tag }} :</td>
		    <td>{{ formInventory.name }}</td>
		    <td>{{ formInventory.quantity.label_tag }} :</td>
		    <td>{{ formInventory.quantity }}</td>
		</tr>
		<tr><td td colspan="4">
			<div>{{ formInventory.description }}</div>
		    </td>
		</tr>
		<tr><td td colspan="4" style="text-align:right;"><input type="submit" id="addItem" name="addItem" value="Save" alt="Save Item" /></td>
		</tr>
	</table>
	{{ formInventory.isEdit }}
	</formInventory>
	{% if isErrorInventory %}<p id="errorMessage">The Item is not valid, please fill up the name, quantity and description fields</p>{% endif %}
	{% for id, name, description, quantity in items %}
	<div class="inventoryItem" id="{{id}}">
		<div class="header">
			<div class="quantity">
				 {{quantity}}
			</div>
			<span class="name">{{name|safe}}</span>
			 - <a href="/team/playerForMaster/{{char_sheet.player_id}}/editItem/{{id}}/"><small>edit</small></a>
			 - <a href="" onclick="confirmDeletePlayer('{{ id }}', '{{ name }}', '{{char_sheet.player_id}}')"><small>delete</small></a>
		</div>
		<div class="content">
		{{description|safe}}
		</div>
	</div>
	{% endfor %}
</div>
{% include "rpgEngine/foot.html" %}


